#!/bin/bash

if [ $(vncviewer --help 2>&1 | head -1 - | cut -f1 -d" ") = "TightVNC" ]; then
	export VNC_VIA_CMD="/usr/bin/ssh -2 -x -p 20022 -f -L %L:%H:%R %G sleep 20"
	vncviewer -encodings Tight -depth 8 -via aliens.dynalias.org localhost:64
else
	echo "TightVNC viewer is not installed. On Debian use 'apt-get install xtightvncviewer'."
fi

